package JLB_Chapter_08;

public class Tran {
    static void avg(int age) throws MyException {
        if(age < 0) {
            throw new MyException("年龄不能为负数");
        } else {
            System.out.println("王师傅今年" + age + "岁了！");
        }
    }
    public static void main(String[] args){
        try {
            avg(-50);
        } catch(MyException e) {
            e.printStackTrace();
        }
    }
}
